package com.atguigu.gulimail.product.web.Vo;

import com.atguigu.gulimail.product.entity.SkuImagesEntity;
import com.atguigu.gulimail.product.entity.SkuInfoEntity;
import com.atguigu.gulimail.product.entity.SpuInfoDescEntity;
import com.atguigu.gulimail.product.entity.SpuInfoEntity;
import com.atguigu.gulimail.product.vo.Attr;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.List;

@Data
public class SkuItemVo {

    private boolean hasStock = true;
    //6、秒杀商品的优惠信息
    private SeckillSkuVo seckillSkuVo;

    //sku基本信息获取
    SkuInfoEntity info;
    //sku图片信息
    List<SkuImagesEntity> images;
    //spu的介绍
    SpuInfoDescEntity desc;
    //3、获取spu的销售属性组合
    List<SkuItemSaleAttrVo> saleAttr;
    //spu规格参数信息
    List<SpuItemAttrGroupVo> groupAttrs;



    @Data
    public static class SkuItemSaleAttrVo{
        private Long attrId;

        private String attrName;

        private List<AttrValueWithSkuIdVo> attrValues;

    }

    @Data
    public static class AttrValueWithSkuIdVo {

        private String attrValue;

        private String skuIds;

    }


    @Data
    @ToString
    public static class SpuItemAttrGroupVo {

        private String groupName;

        private List<Attr> attrs;

    }


    @Data
    public class SeckillSkuVo {

        /**
         * 活动id
         */
        private Long promotionId;
        /**
         * 活动场次id
         */
        private Long promotionSessionId;
        /**
         * 商品id
         */
        private Long skuId;
        /**
         * 秒杀价格
         */
        private BigDecimal seckillPrice;
        /**
         * 秒杀总量
         */
        private Integer seckillCount;
        /**
         * 每人限购数量
         */
        private Integer seckillLimit;
        /**
         * 排序
         */
        private Integer seckillSort;

        //当前商品秒杀的开始时间
        private Long startTime;

        //当前商品秒杀的结束时间
        private Long endTime;

        //当前商品秒杀的随机码
        private String randomCode;

    }
}
